<template></template>
<script setup lang="ts">
import userStore from "@/store/user";
import permissionStore from "@/store/permission";
import { useRouter } from "vue-router";
let userInfo = userStore();
let permission = permissionStore();
let router = useRouter();
if (userInfo.token) {
    let { path = "", redirect = "" } = permission.homeRoute;
    redirect || path ? router.push(redirect || path) : router.push("/login");
} else {
    router.push("/login");
}
</script>
